package com.foyekoo.project001.utils;

import android.database.sqlite.SQLiteDatabase;
import android.os.Environment;


public class DBUtil {

    private static String bill = "/storage/emulated/0/bill.db";
    private static String coin = "/storage/emulated/0/coin.db";
    private static boolean initTmpDB =false;

    /**
     * 此数据库用于保存当前的临时的
     * @return
     */
    public static synchronized SQLiteDatabase initBillDB() {
        // init
        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(bill, null);

        db.execSQL("create table if not exists bill( id integer PRIMARY KEY AUTOINCREMENT , bill_date String,coin_num String , prize_num String)");
        return db;
    }

    public static synchronized SQLiteDatabase initCoinNumDB() {
        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(coin, null);

        db.execSQL("create table if not exists bill( id integer PRIMARY KEY AUTOINCREMENT , coin_date String,coin_num String)");

        return db;

    }
}
